package cn.tedu.csmall.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@Accessors(chain = true)
public class CategoryAddNewDTO implements Serializable {

    @ApiModelProperty(value = "类别名称", example = "手机", required = true)
    @NotNull(message = "增加类别失败，必须提交类别名称")
    private String name;

    @ApiModelProperty(value = "父级类别id", example = "0", required = true)
    @NotNull(message = "增加类别失败，必须提交父级类别")
    private Long parentId;

    @ApiModelProperty(value = "类别关键词", example = "手机", required = true)
    @NotNull(message = "增加类别失败，必须提交类别关键词")
    private String keywords;

    @ApiModelProperty(value = "自定义排序序号", example = "66", required = true)
    @NotNull(message = "增加类别失败，必须提交类别排序序号")
    @Range(max = 99, message = "增加类别失败，自定义排序序号必须是0~99之间的值！")
    private Integer sort;

    @ApiModelProperty(value = "图标的URL", example = "...", required = true)
    @NotNull(message = "增加类别失败，必须提交类别图标")
    private String icon;

    @ApiModelProperty(value = "是否启用，1=启用，0=禁用", example = "0", required = true)
    @NotNull(message = "增加类别失败，必须设置是否启用")
    @Range(max = 1)
    private Integer enable;

    @ApiModelProperty(value = "是否显示在导航栏，1=显示，0=隐藏", example = "1", required = true)
    @NotNull(message = "增加类别失败，必须设置显示")
    @Range(max = 1)
    private Integer display;
}
